package phapp.model.barapp;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import javacommon.base.BaseEntity;


/**
 * <p> 标题: 酒吧活动表, tc_bar_act_info 数据类 POJO
 * <p>Description: DAO层映射到数据类,页面封装数据映射到数据类
 * <p>Copyright: Copyright (c) 2014-10
 * <p>Company: 
 * @author you name
 * @version 1.0
*/

public class BarAct extends BaseEntity {
   
   //date formats
   public static final String FORMAT_ACTIVITY_TIME = DATE_FORMAT;
   public static final String FORMAT_CREATE_TIME = DATE_TIME_FORMAT;
   
   //columns START
   /**序列*/
   private java.lang.Integer id;
   /**活动标题*/
   private java.lang.String title;
   /**活动时间*/
   private java.sql.Date activityTime;
   /**图URL*/
   private java.lang.String imgurl;
   /**内容*/
   private java.lang.String content;
   /**创建人ID*/
   private java.lang.Integer menberId;
   /**酒吧ID*/
   private java.lang.Integer barId;
   /**酒吧名称*/
   private java.lang.String barName;
   /**创建时间*/
   private java.sql.Timestamp createTime;
   
   private java.util.ArrayList idList;
   //columns END

	public BarAct(){
	}

	public BarAct(
		java.lang.Integer id
	){
		this.id = id;
	}

   public void setId(java.lang.Integer value) {
      this.id = value;
   }
   
   public java.lang.String getBarName() {
	return barName;
}

public void setBarName(java.lang.String barName) {
	this.barName = barName;
}

public java.lang.Integer getId() {
      return this.id;
   }
   public String getActivityTimeString() {
      return date2String(getActivityTime(), FORMAT_ACTIVITY_TIME);
   }
   
   public java.lang.String getTitle() {
	return title;
	}
	
	public void setTitle(java.lang.String title) {
		this.title = title;
	}

	public void setActivityTimeString(String value) {
      setActivityTime(string2Date(value, FORMAT_ACTIVITY_TIME,java.sql.Date.class));
   }
   
   public void setActivityTime(java.sql.Date value) {
      this.activityTime = value;
   }
   
   public java.sql.Date getActivityTime() {
      return this.activityTime;
   }

   
   public java.lang.String getImgurl() {
	return imgurl;
	}
	
	public void setImgurl(java.lang.String imgurl) {
		this.imgurl = imgurl;
	}
	
	public void setContent(java.lang.String value) {
      this.content = value;
   }
   
   public java.lang.String getContent() {
      return this.content;
   }
   public void setMenberId(java.lang.Integer value) {
      this.menberId = value;
   }
   
   public java.lang.Integer getMenberId() {
      return this.menberId;
   }
   public void setBarId(java.lang.Integer value) {
      this.barId = value;
   }
   
   public java.lang.Integer getBarId() {
      return this.barId;
   }
   public String getCreateTimeString() {
      return date2String(getCreateTime(), FORMAT_CREATE_TIME);
   }
   
   public void setCreateTimeString(String value) {
      setCreateTime(string2Date(value, FORMAT_CREATE_TIME,java.sql.Timestamp.class));
   }
   
   public void setCreateTime(java.sql.Timestamp value) {
      this.createTime = value;
   }
   
   public java.sql.Timestamp getCreateTime() {
      return this.createTime;
   }

   public java.util.ArrayList getIdList() {
      return idList;
   }

   public void setIdList(java.util.ArrayList idList) {
      this.idList = idList;
   }

    /**手动增加属性后,toString,hashCode,equals都要修改*/
   public String toString() {
      return new ToStringBuilder(this)
         .append("Id",getId())
         .append("ActivityTime",getActivityTime()) 
         .append("Imgurl",getImgurl())
         .append("Content",getContent())
         .append("MenberId",getMenberId())
         .append("BarId",getBarId())
         .append("Title",getTitle())
         .append("CreateTime",getCreateTime())
         .toString();
   }
   
   public int hashCode() {
      return new HashCodeBuilder()
         .append(getId())
         .append(getActivityTime()) 
         .append(getImgurl())
         .append(getContent())
         .append(getMenberId())
         .append(getBarId())
         .append(getTitle())
         .append(getCreateTime())
         .toHashCode();
   }
   
   public boolean equals(Object obj) {
      if(obj instanceof BarAct == false) return false;
      if(this == obj) return true;
      BarAct other = (BarAct)obj;
      return new EqualsBuilder()
         .append(getId(),other.getId())
         .append(getActivityTime(),other.getActivityTime()) 
         .append(getImgurl(),other.getImgurl())
         .append(getContent(),other.getContent())
         .append(getMenberId(),other.getMenberId())
         .append(getBarId(),other.getBarId())
         .append(getTitle(),other.getTitle())
         .append(getCreateTime(),other.getCreateTime())
         .isEquals();
   }
}

